/**
 * Created With IntelliJ IDEA
 * Description:leetcode：709. 转换成小写字母
 * <a href="https://leetcode.cn/problems/to-lower-case/">...</a>
 * User: DELL
 * Data: 2022-11-21
 * Time: 0:36
 */
class Solution {
    public String toLowerCase(String s) {
        char[] buffer = new char[s.length()];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if (ch >= 'A' && ch <= 'Z') {
                buffer[i] = (char)(ch + 32);
            } else {
                buffer[i] = ch;
            }
        }
        return new String(buffer);
    }
}